﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.IO;
using System.Reflection;
using NAntMenu.Core;

namespace NAntMenu.Test
{
    [TestFixture]
    public class CoreTests
    {
        private string SamplesDirectory { get; set; }

        [TestFixtureSetUp]
        public void SetUp()
        {
            SamplesDirectory = Path.GetFullPath("Samples");
        }

        [Test]
        public void Test_Samples_NAntBuildFile_Targets()
        {
            string nantBuildFilePath = Path.Combine(this.SamplesDirectory, "HelloWorld.build");

            NAntBuildFile nantBuildFile = new NAntBuildFile(nantBuildFilePath);

            Assert.IsNotNull(nantBuildFile.Targets);
            Assert.IsTrue(nantBuildFile.Targets.Contains("clean"));
            Assert.IsTrue(nantBuildFile.Targets.Contains("build"));
            Assert.AreEqual("build", nantBuildFile.DefaultTarget.Name);
        }
    }
}
